﻿<html>

	<head>
		<title>新增热门词汇</title>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">

		<link href="../../css/skin/default/style.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" href="../../css/dialog.css">
		<link href="../../js/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />

		<script src="../../js/lib/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>

		<script src="../../js/lib/ligerUI/js/plugins/ligerPopupEdit.js"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerForm.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerRadio.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTip.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerMenu.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerToolBar.js" type="text/javascript"></script>
		<script src="../../JS/XHD.js" type="text/javascript"></script>
		<script src="../../js/lib/jquery.form.js" type="text/javascript"></script>
		<script src="../../js/lib/json2.js" type="text/javascript"></script>
		<script src="../../js/dialog.js"></script>
		<script src="../../js/JS/layout.js"></script>
		<script src="../../js/constants.js" type="text/javascript"></script>
		<script src="../../js/api.js" type="text/javascript"></script>
		<script type="text/javascript">
			var id;
			var row;
			$(function() {

				$("form").ligerForm();
				initview();
				row = JSON.parse(unescape($api.getparastr("data")));
				if(row) {
					$("#Frow").val(row.Frow);
					$("#Fimg").attr("src", row.Fhimg);
					popProduct.setValue(row.Fid);
					popProduct.setText(row.Fsummary + "[" + row.Fpcode + "]");

				}

			});
			var popProduct;

			function initview() {
				popProduct = $("#Fpid").ligerPopupEdit({
					valueField: 'Fid',
					textField: 'Fname',
					width: 160,
					onEnterDown: function(e) {
						parent.f_ProductWin('ischild=1&cmd=cartad');
					},
					onButtonClick: function() {
						parent.f_ProductWin('ischild=1&cmd=cartad');
					}

				});
			}

			function putProducts(rows) {
				var row = rows[0];
				$("#Fimg").attr("src", row.Fhimg);
				popProduct.setValue(row.Fid);
				popProduct.setText(row.Fsummary + "[" + row.Fpcode + "]");
			}

			function f_save() {
				if(!$("#Fpid").val()) {
					top.$.ligerDialog.error('请选择商品不能为空！');

					return;
				}
				if(!$("#Frow").val()) {
					top.$.ligerDialog.error('排序号不能为空！');
					return;
				}
				if(id) {
					var ret = $("form").serializeObject();
					ret.Fid = row.Fadid;
					ret.Fsid = row.Fsid;
					ret.Fpid = popProduct.getValue();
					var obj = {
						"data": ret,
						"action": "edit"
					};
					return obj;
				} else {
					var ret = $("form").serializeObject();

					ret.Fpid = popProduct.getValue();
					var obj = {
						"data": ret,
						"action": "add"
					};
					return obj;
				}

			}
		</script>
	</head>

	<body>
		<form id="form1" onsubmit="return false">
			<div>
				<table style="width:450px;" class='bodytable'>
					<tr>
						<td width="65px" align="right">
							商品主图</td>
						<td>
							<div style="float:left;" class="picContainer">
								<img id="Fimg" src="../../css/skin/default/add_pic.png" onclick="imgshow(this);" class="imgs" />
							</div>
						</td>
					</tr>
					<tr>
						<td width="65px" align="right">
							推荐类别</td>
						<td>
							<div style="float:left;">
								<select name="Ftype" id="Ftype" ltype="select" ligerui="{width:180}"> 
									<option value="1" selected="selected">促销商品</option>
									<option value="2">推荐商品</option>
								</select>
							</div>
						</td>
					</tr>

					<tr>
						<td width="65px" align="right">
							商品</td>
						<td>
							<div style="float:left;">
								<input type="text" id="Fpid" name="Fpid" ligerui="{width:280}" validate="{required:true}" />
							</div>
						</td>
					</tr>
					<tr>
						<td width="65px" align="right">
							排序号</td>
						<td>
							<input type="text" id="Frow" name="Frow" ltype="text" ligerui="{width:180,digits:true }" validate="{required:true}" />

						</td>
					</tr>
				</table>
			</div>
		</form>
	</body>

</html>